package lormi.meipin.service.impl;


import java.util.Date;

import org.springframework.stereotype.Service;

import lormi.meipin.entity.Share;
import lormi.meipin.exception.LMException;
import lormi.meipin.service.BaseService;
import lormi.meipin.service.IShareService;

@Service
public class ShareService extends BaseService implements IShareService{

	@Override
	public void addShare(Integer userid, Integer sharetype, Integer viewnum) throws LMException {
		Share record = new Share();
		record.setUserid(userid);
		record.setSharetype(new Byte(sharetype+""));
		record.setViewnum(viewnum);
		record.setCreatetime(new Date());

		if(shareMapper.insert(record)<1){
			throw new LMException(100035);
		}
	}

}
